home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / swagdef.zip / DESQVIEW.SWG < prev    next >
Text File  |  1993-05-28  |  11KB  |  1 lines

  1. SWAGOLX.EXE (c) 1993 GDSOFT  ALL RIGHTS RESERVED 00003         DESQVIEW ROUTINES                                                 1      05-28-9313:37ALL                      SWAG SUPPORT TEAM        DESQVIEW.PAS             IMPORT              39          { Does anyone know the routine For making a Program DV aware, and if itπ finds it, can you get it to make calls to it instead of Dos?π}πHere is a desqview Unit I have used in the past.ππUnit DESQVIEW ;ππ{$O+,F+}ππInterfaceππUses Dos ;ππVarπ  DV_ACTIVE    : Boolean ;          { True if running under DESQview     }π  Win_ACTIVE   : Boolean ;          { True if Windows 3.x Enhanced Mode  }π  DV_VERSION   : Word ;             { desqVIEW version number            }π  DV_VSEG      : Word ;π  DV_VMODE     : Byte Absolute $0040:$0049 ;π  DV_VWIDTH    : Byte ;π  DV_VROWS     : Byte ;π  DV_VofS      : Word ;πππProcedure DV_RQM   ;                { Give up the rest of our timeslice  }πProcedure DV_begin_CRITICAL ;       { Turn Task Switching off.           }πProcedure DV_end_CRITICAL ;         { Turn switching back on.            }πProcedure DV_VIDEO_BUFFER ;         { Set Global Video Variables         }πFunction  DV_Window_NUMBER : Byte ; { Returns Window Number              }πProcedure DV_COMMON_MEMorY(Var AVAIL, LARGEST, toTAL: Word) ;πProcedure DV_CONV_MEMorY  (Var AVAIL, LARGEST, toTAL: Word) ;πProcedure DV_EMS_MEMorY   (Var AVAIL, LARGEST, toTAL: Word) ;πProcedure DV_FASTWrite    (X,Y: Word; STR: String; FG,BG: Word) ;ππImplementationππVarπ  REG     : Registers ;ππProcedure DV_RQM ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, 1000hπ      int  15hπ    end ;π  end else beginπ    if Win_ACTIVE then beginπ      Asmπ        mov  ax, 1680hπ        int  2fhπ      end ;π    end ;π  end ;πend { dv_rqm };ππProcedure DV_begin_CRITICAL ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov   ax, $101bπ      int   15hπ    end ;π  end else beginπ    if Win_ACTIVE then beginπ      Asmπ        mov  ax, 1681hπ        int  2fhπ      end ;π    end ;π  end ;πend ; { dv_begin_critical }ππProcedure DV_end_CRITICAL ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov   ax, $101cπ      int   15hπ    end ;π  end else beginπ    if Win_ACTIVE then beginπ      Asmπ        mov  ax, $1682π        int  2fhπ      end ;π    end ;π  end ;πend ; { dv_end_critical }ππProcedure DV_VIDEO_BUFFER ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $2b02π      mov  bx, $4445  ; { DE }π      mov  dx, $5351  ; { SQ }π      int  21hπ      mov  DV_VSEG, dxπ      mov  DV_VWIDTH, blπ      mov  DV_VROWS, bhπ      mov  DV_VofS, 0π    end ;π  end else beginπ    if (DV_VMODE = 7) then DV_VSEG := $b000 else DV_VSEG := $b800 ;π    DV_VWIDTH := memw[$0040:$004a] ;π    DV_VROWS  := 25 ;π    DV_VofS   := memw[$0040:$004e] ;π  end ;πend ; { dv_video_buffer }ππFunction DV_Window_NUMBER ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov   ax, $de07π      int   15hπ      mov  @RESULT, alπ    end ;π  end else beginπ    DV_Window_NUMBER := 0 ;π  end ;πend ;ππProcedure DV_COMMON_MEMorY ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $de04π      int  15hπ      les  di, AVAILπ      mov  es:[di], bxπ      les  di, LARGESTπ      mov  es:[di], cxπ      les  di, toTALπ      mov  es:[di], dxπ    end ;π  end else beginπ    AVAIL := 0 ;π    LARGEST := 0 ;π    toTAL := 0 ;π  end ;πend ;ππProcedure DV_CONV_MEMorY ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $de05π      int  15hπ      les  di, AVAILπ      mov  es:[di], bxπ      les  di, LARGESTπ      mov  es:[di], cxπ      les  di, toTALπ      mov  es:[di], dxπ    end ;π  end else beginπ    AVAIL := 0 ;π    LARGEST := 0 ;π    toTAL := 0 ;π  end ;πend ;ππProcedure DV_EMS_MEMorY ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $de06π      int  15hπ      les  di, AVAILπ      mov  es:[di], bxπ      les  di, LARGESTπ      mov  es:[di], cxπ      les  di, toTALπ      mov  es:[di], dxπ    end ;π  end else beginπ    AVAIL := 0 ;π    LARGEST := 0 ;π    toTAL := 0 ;π  end ;πend ;ππProcedure DV_FASTWrite ;ππVarπ  I      : Word ;ππbeginπ  X := DV_VofS + ((Y-1) * DV_VWIDTH + (X-1)) * 2 ;π  For I := 1 to length(STR) do beginπ    MEMW[DV_VSEG:X] := (((BG shl 4) + FG) shl 8) + ord(STR[I]) ;π    X := X + 2 ;π  end ;πend ;ππbegin { main }π  REG.AX := $2b01 ;π  REG.CX := $4445 ;  { DE }π  REG.DX := $5351 ;  { SQ }π  intr($21,REG) ;ππ  Win_ACTIVE := False ;π  DV_ACTIVE := (REG.AL <> $ff) ;ππ  DV_VERSION := 0 ;π  if DV_ACTIVE then beginπ    DV_VERSION := REG.BX ;π    REG.AX := $de0b ;π    REG.BX := $0200 ;  { Minimum of Desqview 2.00 }π    intr($15,REG) ;π  end else beginπ    REG.AX := $1600 ;π    intr($2f,REG) ;π    Case REG.AL ofπ      $00 : ; { An enhanced Windows API is not Running }π      $80 : ; { An enhanced Windows API is not Running }π      $01 : ; { Windows / 386 Version 2.x              }π      $ff : ; { Windows / 386 Version 2.x              }π      else beginπ        Win_ACTIVE := True ;π        DV_VERSION := swap(REG.AX) ;π      end ;π    end ;π  end ;ππ  DV_VIDEO_BUFFER ;πend. { main }π                                                                          2      05-28-9313:37ALL                      SWAG SUPPORT TEAM        DETCTWIN.PAS             IMPORT              38          {πHere's a little something that will detect Desqview and Windows ...π}πUnit DESQVIEW ;π{$O+,F+}ππInterfaceπUses Dos, Crt;ππVarπ  DV_ACTIVE    : Boolean ;          { True if running under DESQview     }π  Win_ACTIVE   : Boolean ;          { True if Windows 3.x Enhanced Mode  }π  DV_VERSION   : Word ;             { desqVIEW version number            }π  DV_VSEG      : Word ;π  DV_VMODE     : Byte Absolute $0040:$0049 ;π  DV_VWIDTH    : Byte ;π  DV_VROWS     : Byte ;π  DV_VofS      : Word ;πππProcedure DV_RQM   ;                { Give up the rest of our timeslice  }πProcedure DV_begin_CRITICAL ;       { Turn Task Switching off.           }πProcedure DV_end_CRITICAL ;         { Turn switching back on.            }πProcedure DV_VIDEO_BUFFER ;         { Set Global Video Variables         }πFunction  DV_Window_NUMBER : Byte ; { Returns Window Number              }πProcedure DV_COMMON_MEMorY(Var AVAIL, LARGEST, toTAL: Word) ;πProcedure DV_CONV_MEMorY  (Var AVAIL, LARGEST, toTAL: Word) ;πProcedure DV_EMS_MEMorY   (Var AVAIL, LARGEST, toTAL: Word) ;πProcedure DV_FASTWrite    (X,Y: Word; STR: String; FG,BG: Word) ;ππImplementationππVarπ  REG     : Registers ;ππProcedure DV_RQM ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, 1000hπ      int  15hπ    end ;π  end else beginπ    if Win_ACTIVE then beginπ      Asmπ        mov  ax, 1680hπ        int  2fhπ      end ;π    end ;π  end ;πend;ππProcedure DV_begin_CRITICAL ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov   ax, $101bπ      int   15hπ    end ;π  end else beginπ    if Win_ACTIVE then beginπ      Asmπ        mov  ax, 1681hπ        int  2fhπ      end ;π    end ;π  end ;πend ; { dv_begin_critical }ππProcedure DV_end_CRITICAL ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov   ax, $101cπ      int   15hπ    end ;π  end else beginπ    if Win_ACTIVE then beginπ      Asmπ        mov  ax, $1682π        int  2fhπ      end ;π    end ;π  end ;πend ; { dv_end_critical }ππProcedure DV_VIDEO_BUFFER ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $2b02π      mov  bx, $4445  ; { DE }π      mov  dx, $5351  ; { SQ }π      int  21hπ      mov  DV_VSEG, dxπ      mov  DV_VWIDTH, blπ      mov  DV_VROWS, bhπ      mov  DV_VofS, 0π    end ;π  end else beginπ    if (DV_VMODE = 7) then DV_VSEG := $b000 else DV_VSEG := $b800 ;π    DV_VWIDTH := memw[$0040:$004a] ;π    DV_VROWS  := 25 ;π    DV_VofS   := memw[$0040:$004e] ;π  end ;πend ; { dv_video_buffer }ππFunction DV_Window_NUMBER ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov   ax, $de07π      int   15hπ      mov  @RESULT, alπ    end ;π  end else beginπ    DV_Window_NUMBER := 0 ;π  end ;πend ;ππProcedure DV_COMMON_MEMorY ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $de04π      int  15hπ      les  di, AVAILπ      mov  es:[di], bxπ      les  di, LARGESTπ      mov  es:[di], cxπ      les  di, toTALπ      mov  es:[di], dxπ    end ;π  end else beginπ    AVAIL := 0 ;π    LARGEST := 0 ;π    toTAL := 0 ;π  end ;πend ;ππProcedure DV_CONV_MEMorY ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $de05π      int  15hπ      les  di, AVAILπ      mov  es:[di], bxπ      les  di, LARGESTπ      mov  es:[di], cxπ      les  di, toTALπ      mov  es:[di], dxπ    end ;π  end else beginπ    AVAIL := 0 ;π    LARGEST := 0 ;π    toTAL := 0 ;π  end ;πend ;ππProcedure DV_EMS_MEMorY ;ππbeginπ  if DV_ACTIVE then beginπ    Asmπ      mov  ax, $de06π      int  15hπ      les  di, AVAILπ      mov  es:[di], bxπ      les  di, LARGESTπ      mov  es:[di], cxπ      les  di, toTALπ      mov  es:[di], dxπ    end ;π  end else beginπ    AVAIL := 0 ;π    LARGEST := 0 ;π    toTAL := 0 ;π  end ;πend ;ππProcedure DV_FASTWrite ;ππVarπ  I      : Word ;ππbeginπ  X := DV_VofS + ((Y-1) * DV_VWIDTH + (X-1)) * 2 ;π  For I := 1 to length(STR) do beginπ    MEMW[DV_VSEG:X] := (((BG shl 4) + FG) shl 8) + ord(STR[I]) ;π    X := X + 2 ;π  end ;πend ;ππbegin { main }π  REG.AX := $2b01 ;π  REG.CX := $4445 ;  { DE }π  REG.DX := $5351 ;  { SQ }π  intr($21,REG) ;ππ  Win_ACTIVE := False ;π  DV_ACTIVE := (REG.AL <> $ff) ;ππ  DV_VERSION := 0 ;π  if DV_ACTIVE then beginπ    DV_VERSION := REG.BX ;π    REG.AX := $de0b ;π    REG.BX := $0200 ;  { Minimum of Desqview 2.00 }π    intr($15,REG) ;π  end else beginπ    REG.AX := $1600 ;π    intr($2f,REG) ;π    Case REG.AL ofπ      $00 : ; { An enhanced Windows API is not Running }π      $80 : ; { An enhanced Windows API is not Running }π      $01 : ; { Windows / 386 Version 2.x              }π      $ff : ; { Windows / 386 Version 2.x              }π      else beginπ        Win_ACTIVE := True ;π        DV_VERSION := swap(REG.AX) ;π      end ;π    end ;π  end ;ππ  DV_VIDEO_BUFFER ;πend. { main }π                                                                     3      05-28-9313:37ALL                      SWAG SUPPORT TEAM        DV-VIDEO.PAS             IMPORT              7           {π> Has anyone done any work With DV's virtual screen?  Someplace Iπ> used to have the address For it, but I seem to have lost it.  Doesπ> anybody know what it is?ππ> What I'm trying to do is bypass TJT's direct screen Writes byπ> replacing the BaseOfScreen Pointer With the one For DV's virtualπ> screen. if I can't do that then I'm going to have to make anotherπ> attempt at rewriting the assembly level screen routines.π}ππFunction DV_Video_Buffer;πbeginπ  Reg.AH := $0F;π  INTR($10, Reg);π  if Reg.AL = 7 thenπ    Reg.ES := $B000π  elseπ    Reg.ES := $B800;π  if DV_Loaded thenπ  beginπ    Reg.DI := 0;π    Reg.AX := $FE00;π    INTR($10, Reg);π  end;π  DV_Video_Buffer := Reg.ES;πend;π